import React, { Component } from 'react';
import * as service from "../../api/index";


import "../../styles/Index/List.scss"

class MyEntry extends Component {
    constructor(props) {
        super(props);
        this.state = {
            indexnavlist: []
        }
    }

    async componentDidMount() {
        var res = await service.index_nav();
        // console.log(res.data.list);
        this.setState({ indexnavlist: res.data.list })
    }

    render() {
        return (
            <div className='list'>
                {
                    this.state.indexnavlist.map((item, index) => {
                        return (
                            <div className="item" key={index}>
                                <img src={item.pic} alt="" />
                                <div className="text">{item.name}</div>
                            </div>
                        )
                    })
                }
            </div>
        );
    }
}

export default MyEntry;